home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / falclib2.lzh / ROUTS / SETFV.S < prev    next >
Text File  |  1994-08-18  |  2KB  |  96 lines

  1. *
  2. * SETFV.S
  3. *
  4. *    @setfv
  5. *     Sets the falcon video registers. The data that is
  6. *     written to the video registers must be a .FV (Falcon Video)
  7. *     file. Supervisor only.
  8. * In     a0.l=adr. to Falcon Video data
  9. * Out     d0.l: 0=no error  -1=error, no FV data  -2=error, wrong monitor (not used yet)
  10. *     (destroys a0-a1)
  11. *
  12. *    @savefv
  13. *     Saves the falcon video registers to memory. Supervisor only.
  14. *     (destroys a0-a1)
  15. *
  16. *    @resorefv
  17. *     Restores the saved falcon video registers. Supervisor only.
  18. *     (destroys a0-a1)
  19. *
  20.  
  21.  
  22. @setfv        cmp.l    #'FVDO',(a0)+    4 bytes header
  23.         bne    .error
  24. *        cmp.b    #0,$ff8006
  25. *        beq    .sm124
  26. *        cmp.b    #2,$ff8006
  27. *        beq    .vga
  28. *.rgb        cmp.b    #0,(a0)
  29. *        beq    .wrongmon
  30. *        cmp.b    #2,(a0)
  31. *        beq    .wrongmon
  32.         
  33. .ready        addq.l    #2,a0
  34.         move.l    $70,-(sp)
  35.         move    sr,-(sp)
  36.         move.l    #.vbl,$70
  37.         move    #$2300,sr
  38.         
  39.         move.l    $466,d0
  40. .wait        cmp.l    $466,d0
  41.         beq    .wait
  42.         
  43.         move.l    (a0)+,$ff820e    offset & vwrap
  44.         move.w    (a0)+,$ff8266    spshift
  45.         move.l    #$ff8282,a1    horizontal control registers
  46. .loop1        move    (a0)+,(a1)+
  47.         cmp.l    #$ff8292,a1
  48.         bne    .loop1
  49.         move.l    #$ff82a2,a1    vertical control registers
  50. .loop2        move    (a0)+,(a1)+
  51.         cmp.l    #$ff82ae,a1
  52.         bne    .loop2
  53.         move    (a0)+,$ff82c2    video control
  54.         move    (sp)+,sr
  55.         move.l    (sp)+,$70
  56.         moveq    #0,d0
  57.         rts
  58. .error        moveq    #-1,d0
  59.         rts
  60. .wrongmon    moveq    #-2,d0
  61.         rts
  62. .sm124        cmp.b    #0,(a0)
  63.         bne    .wrongmon
  64.         bra    .ready
  65. .vga        cmp.b    #2,(a0)
  66.         bne    .wrongmon
  67.         bra    .ready
  68. .vbl        addq.l    #1,$466
  69.         rte
  70.         
  71.  
  72. @savefv        lea    FVbuffer1298,a1
  73.         move.l    #'FVDO',(a1)+    4 bytes header
  74.         move.b    $ff8006,(a1)+    monitor type
  75.         move.b    $ff820a,(a1)+    sync
  76.         move.l    $ff820e,(a1)+    offset & vwrap
  77.         move.w    $ff8266,(a1)+    spshift
  78.         move.l    #$ff8282,a0    horizontal control registers
  79. .loop1        move    (a0)+,(a1)+
  80.         cmp.l    #$ff8292,a0
  81.         bne    .loop1
  82.         move.l    #$ff82a2,a0    vertical control registers
  83. .loop2        move    (a0)+,(a1)+
  84.         cmp.l    #$ff82ae,a0
  85.         bne    .loop2
  86.         move    $ff82c2,(a1)+    video control
  87.         rts
  88.         
  89. @restorefv    move.l    #FVbuffer1298,a0
  90.         bsr    @setfv
  91.         rts
  92.  
  93.  
  94. FVbuffer1298    ds.w    22
  95.  
  96.